<%--
  Created by IntelliJ IDEA.
  User: cod01
  Date: 2022/6/4
  Time: 13:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8" import="com.dhee.entity.UserEntity" %>
<html>
<head>
    <title>XSS</title>
    <link rel="stylesheet" type="text/css" href="./css/sql.css">
</head>
<body>
    <%
        if (session.getAttribute("userInfo") != null) {
            UserEntity user = (UserEntity) session.getAttribute("userInfo");
    %>
    <%
        }
    %>
<%--    <h1 align="center">--%>
<%--        XSS--%>
<%--    </h1>--%>

    <div class="container right-panel-active">
        <div class="container__form container--signup">
    <form action="xss" method="post" name="" class="form" id="form1">
        <h2 class="form__title">XSS检测</h2>

        <input name="urlEntity.url" type="text" size="40" id="myurl" class="input" placeholder="目标网站链接"/>
        <input name="submit" type="submit" class="btn" value="开始检测">
    </form>
            <%
                if (session.getAttribute("xss") != null) {
                    Boolean b = (Boolean) session.getAttribute("xss");

                    if (b) {
            %>
            <script type="text/javascript">
                alert("url存在xss漏洞!");
            </script>
            <%
            } else {
            %>
            <script type="text/javascript">
                alert("url不存在xss漏洞!");
            </script>
            <%
                    }
                    session.removeAttribute("xss");
                }
            %>
        </div>

        <!-- Overlay -->
        <div class="container__overlay">
            <div class="overlay">
                <div class="overlay__panel overlay--left">
                    <h2 style="color:white"><%
                        if (session.getAttribute("userInfo") != null) {
                            UserEntity user = (UserEntity) session.getAttribute("userInfo");
                    %>
                        <div>欢迎<%=user.getName() %>登录！</div>
                        <%
                            }

                        %></h2>
                    <a class="btn" href="index.jsp" style="
                            border-bottom-width: 1px;
                            margin-bottom: 10px;
                        ">网络爬虫</a>
                    <a class="btn" href="sql.jsp" style="
                            border-bottom-width: 1px;
                            margin-bottom: 10px;
                        ">sql注入 </a>

                    <a class="btn" href="getUrl" style="
                        border-bottom-width: 1px;
                        margin-bottom: 10px;
                    ">url管理</a>
                    <a class="btn" href="login.jsp" style="
                        border-bottom-width: 1px;
                        margin-bottom: 10px;
                    ">退出系统</a>
                </div>

            </div>
        </div>
    </div>
</body>
</html>
